<?php
/**
 * 管理文章模版
 * $Id: manage_article.php 202 2010-11-15 12:36:01Z bwanglei@gmail.com $
 */?>
<div id="main"><div>
	<a <?php if ($_GET['type']=='draft') echo 'style="font-weight:bold;" ';?>href="<?php echo $blogUrl;?>/admin/manage_article.php?type=draft">草稿</a>
	&nbsp;&nbsp;&nbsp;
	<a <?php if ($_GET['type']=='page') echo 'style="font-weight:bold;" ';?>href="<?php echo $blogUrl;?>/admin/manage_article.php?type=page">页面</a>
	&nbsp;&nbsp;&nbsp;
	<a <?php if ($_GET['type']=='article') echo 'style="font-weight:bold;" ';?>href="<?php echo $blogUrl;?>/admin/manage_article.php?type=article">文章</a>
</div><div>
	<table width="100%"><tr style="font-weight:bold;">
		<td>ID</td><td>标题</td><td>发表时间</td><td>浏览次数</td><td>修改</td><td>删除</td>
	</tr>
	<?php
	foreach ($articles as $article) {
		?>
		<tr><td><?php echo $article['id'];?></td>
		<td><?php echo $article['title'];?></td>
		<td><?php echo date('Y-n-j G:i l', $article['time_date']);?></td>
		<td><?php echo $article['views'];?></td>
		<td><a href="<?php echo $blogUrl;?>/admin/new_edit_article.php?action=edit&aid=<?php echo $article['id'];?>">编辑</a></td>
		<td><form method="post" action="<?php echo $blogUrl;?>/admin/manage_article.php?<?php echo rebuild_query_string(array('action'=>'del'));?>">
			<input name="id_article" type="hidden" value="<?php echo $article['id'];?>" />
			<input onclick="return confirm('确定要删除这篇文章吗？');" type="submit" value="删除" />
		</form></td></tr>
		<?php
	}?></table>
</div>

<!-- 页面导航-->
<div id="pagenavi">
<?php
if ($pre_bookmark) {
	$b = array('b'=>$pre_bookmark);
	?>
	<div id="pre_page"><a class="sided" href="<?php echo $blogUrl;?>/admin/manage_article.php?<?php echo rebuild_query_string($b);?>">上一页</a></div>
	<?php
}

if ($next_bookmark) {
	$b = array('b'=>$next_bookmark);
	?>
	<div id="next_page"><a class="sided" href="<?php echo $blogUrl;?>/admin/manage_article.php?<?php echo rebuild_query_string($b);?>">下一页</a></div>
	<?php
}?>
</div></div>
